//
//  Step3Icon.m
//  Gunz
//
//  Created by Joggy on 16/4/16.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "Step3Icon.h"
#import "GZConst.h"

@implementation Step3Icon

-(instancetype)initWithTitle:(NSString *)title {
    self = [super initWithFrame:CGRectMake(0, 0, [GZConst getScreenWidth], 60)];
    UILabel *titleLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 110*proportion, 17)];
    CGPoint tem = titleLab.layer.position;
    tem.y = self.frame.size.height/2;
    titleLab.layer.position = tem;
    titleLab.textColor = TEXT_TITLE_COLOR;
    titleLab.font = [UIFont systemFontOfSize:14];
    titleLab.textAlignment = NSTextAlignmentRight;
    titleLab.text = title;
    [self addSubview:titleLab];
    _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.height, self.frame.size.height)];
    _imageView.layer.position = CGPointMake(152*proportion, self.frame.size.height/2);
    _imageView.image = [UIImage imageNamed:@"插图1"];
    _imageView.contentMode = UIViewContentModeScaleAspectFill;
    _imageView.layer.masksToBounds = true;
    [self addSubview:_imageView];
    _button = [UIButton buttonWithType:UIButtonTypeSystem];
    _button.frame = CGRectMake(_imageView.frame.origin.x + _imageView.frame.size.width + 22, self.frame.size.height - 13, 68, 13);
    [_button setAttributedTitle:[[NSAttributedString alloc] initWithString:@"点击上传" attributes:@{NSForegroundColorAttributeName: CUSTOM_GREEN, NSFontAttributeName: [UIFont systemFontOfSize:12], NSUnderlineStyleAttributeName: [NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineColorAttributeName: CUSTOM_GREEN}] forState:UIControlStateNormal];
    [self addSubview:_button];
    return self;
}

@end
